package com.example.mapp;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;

import com.example.entity.MaintUserAdded;

@Mapper
public interface MaintUserAddedMapp {

	@Insert(" insert into maint_user_added (half_mon_id,maint_content,result) "
			+ "value (#{halfMonId},#{maintContent},#{result})")
	@SelectKey(statement = "select last_insert_id()", keyProperty = "id", keyColumn = "id", before = false, resultType = Long.class)
	int add(MaintUserAdded maintUserAdded) throws Exception;

	@Select("select * from maint_user_added where half_mon_id = #{halfMonId} ")
	List<MaintUserAdded> queryList(String halfMonId);
}
